<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script>
        //URL：http://item.taobao.com/item.htm?a=1&b=2&c=&d=xxx&e
        //截取get数据
        var data = 'http://item.taobao.com/item.html?a=1&b=2&c=&d=xxx&e';
        function getData(str){
            if(str.indexOf('?')===-1) return '';
            var data = str.split('?')[1];
            var reg = /(\w+)=?(\w*)&?/;
            var obj = {};
            while(reg.exec(data)){
                obj[reg.exec(data)[1]] = reg.exec(data)[2];
                data = data.replace(reg.exec(data)[0],'');
            }
            return obj;
        }
        console.log(getData(data));
    </script>
</body>
</html>